package com.lhy.ltss.session;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpSession;

/**
 * @description: 默认会话管理
 * @author: 李汇远
 */
public class DefaultManage {

    /**
     * 获取当前会话
     * @return
     */
    public HttpSession getCurrentSession(){
        ServletRequestAttributes requestAttributes =
                (ServletRequestAttributes)
                        RequestContextHolder.currentRequestAttributes();
        return requestAttributes.getRequest().getSession();
    }
}
